package org.destiny.account.richclient;

import org.destiny.account.entity.Customer;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.rules.Rules;
import org.springframework.rules.support.DefaultRulesSource;

public class CustomerRulesSource extends DefaultRulesSource implements InitializingBean{

	public void afterPropertiesSet() throws Exception {
		doInit();
	}

	private void doInit() {
		Rules userRule = new Rules(Customer.class);
		userRule.add("name", userRule.maxLength(20));
		userRule.add("township", userRule.maxLength(20));
		userRule.add("village",userRule.maxLength(20));
		userRule.add("remark",userRule.maxLength(200));
		addRules(userRule);
	}

}
